<?php

namespace app\store\controller;

use app\Response;
use app\BaseController;
use app\store\service\LoginService;
use think\facade\Request;

class Login extends BaseController
{
    public function login(){
        if (Request::isPost()) {
            $data = $this->request->post();
            try{
                $this->validate($data, 'UserLogin');
            }catch (\Exception $e){
                return Response::wrapError(0,$e->getMessage());
            }
            $result = LoginService::loginService($data);
            return $result;
        }
    }

}